﻿using Abp.Domain.Repositories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Abp.AutoMapper;

namespace MyCompanyName.AbpZeroTemplate.Prm.System
{
    public class ProductAppService : AbpZeroTemplateAppServiceBase, IProductAppService
    {
        private readonly IRepository<Product, int> productRepository;

        public ProductAppService(IRepository<Product, int> _productRepository) 
        {
            productRepository = _productRepository;
        }

        public List<Dto.GetProductOutPut> GetAll()
        {
            var all = productRepository.GetAll();
            var model = all.MapTo<List<Dto.GetProductOutPut>>();
            return model;
        }
    }
}
